<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
    <script src="js/elementUI.js"></script>
    <script src="js/axios.js"></script>
    <link rel="stylesheet" href="css/elementUI.css">
</head>
<body>
<div id="app">
    <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="消息类型">
            <el-radio-group v-model="form.type">
                <el-radio label="1">重要消息</el-radio>
                <el-radio label="0">普通消息</el-radio>
            </el-radio-group>
        </el-form-item>
        <el-form-item label="用户级别">
            <el-select v-model="form.userLevel" placeholder="请选择用户级别" :clearable="true">
                <el-option label="金牌" value="金牌"></el-option>
                <el-option label="银牌" value="银牌"></el-option>
                <el-option label="铜牌" value="铜牌"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="消息内容">
            <el-input type="textarea" v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="活动形式">
            <el-date-picker
                    v-model="form.expireTime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    type="datetime"
                    placeholder="选择日期时间">
            </el-date-picker>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="sendMsg">发送</el-button>
        </el-form-item>
    </el-form>
</div>
<script>
    new Vue({
        el:"#app",
        data:{
            form:{}
        },
        methods:{
            sendMsg(){
                axios.post("/sendMsg",this.form).then(res=>{
                    this.$message({
                        type: 'success',
                        message: '消息发送成功!'
                    });
                })
            }
        },
        created(){

        }
    })
</script>
</body>
</html>